package com.xmx.ordercenter.feign;


import com.xmx.common.utils.PageUtils;
import com.xmx.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @Description: 用一句话描述
 * @Auther: 新梦想*陈超
 * @Date: 2021/8/11 11:25
 */
@FeignClient(value="product-service")
public interface ProductFeignClient {

    @GetMapping("/productcenter/category/list")
    R listChannel(@RequestParam Map<String, Object> params);
    @GetMapping(value = "/productcenter/category/floor")
    R getFloorGoodsList();

    @GetMapping("/productcenter/brand/list")
    R listBrand(@RequestParam Map<String, Object> params);
    @GetMapping("/productcenter/goods/list")
    R listNewGoods(@RequestParam Map<String, Object> params);

    @GetMapping("/productcenter/brand/info/{id}")
    R getbrand(@PathVariable("id") Integer id);

    @GetMapping("/productcenter/brand/getlist")
    R getBdlist(@RequestParam("page") Integer page, @RequestParam("limit") Integer limit);

    @GetMapping("/productcenter/goods/count")
     R count();


    @GetMapping("/productcenter/goods/getBrandlist")
    R getBrandList(@RequestParam("brandId") Integer brandId, @RequestParam("page") Integer page, @RequestParam("limit") Integer limit);

    @GetMapping("/productcenter/goods/detail")
    R detail(@RequestParam("id") Integer id);

    @GetMapping("/productcenter/goods/info/{id}")
     R info(@PathVariable("id") Integer id);

    @GetMapping("/productcenter/goodsspecification/infos/{goods_id}")
    R listspecification(@PathVariable("goods_id") Integer id);

    @GetMapping("/productcenter/comment/infos/{product_id}")
    R listcomment(@PathVariable("product_id") Integer id);

    @GetMapping("/productcenter/goodsattribute/infos/{goods_id}")
    R listgoodattri(@PathVariable("goods_id") Integer id);



    @GetMapping("/productcenter/goodsproduct/infos/{goods_id}")
    R listproduct(@PathVariable("goods_id") Integer id);

    @GetMapping("productcenter/goods/related")
    PageUtils related(@RequestParam("id") Integer id);

    /**
     * 商品服务表
     */
    @GetMapping("productcenter/goodsproduct/info/{id}")
     R goodsproductinfo(@PathVariable("id") Integer id);

    @GetMapping("/productcenter/goodsproduct/reduceStock")
    Integer reduceStock(@RequestParam("orderId") Integer orderId,@RequestParam("id") Integer id, @RequestParam("num") Integer num);

    @GetMapping("/productcenter/goodsproduct/addStock")
    Integer addStock(@RequestParam("orderId") Integer orderId,@RequestParam("id") Integer id, @RequestParam("num") Integer num);
}
